package com.hyving.home.mybatisdemo.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hyving.home.mybatisdemo.repository.entity.Book;
import com.hyving.home.mybatisdemo.repository.mapper.BookMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PageService {



    @Resource
    private BookMapper bookMapper;


    public void test(){
        PageHelper.startPage(1,20);
        List<Book> books = bookMapper.findAll();

        PageInfo<Book> userPageInfo = new PageInfo<>(books);
        List<Book> list = userPageInfo.getList();
    }
}
